import {Component, OnInit} from '@angular/core';
import {AppContextService} from '../../shared/services/app-context.service';

@Component({
  selector: 'app-root',
  template: `
    <router-outlet> </router-outlet>
    <p-growl [value]="msgs"></p-growl>
    <p-confirmDialog [acceptLabel]="app.confirmConfig.yesLabel" [rejectLabel]="app.confirmConfig.noLabel"
                     [acceptIcon]="app.confirmConfig.yesIcon" [rejectIcon]="app.confirmConfig.noIcon" ></p-confirmDialog>
    <!--<app-container [comp]="app.currComp"></app-container>-->
    <ng-template #container></ng-template>
  `,
  styles: [`
    .red{ color: red; }
  `]
})
export class AppComponent implements OnInit {
  title = 'app';
  msgs = [];
  constructor(
    public app: AppContextService
  ) {}
  ngOnInit() {
    this.app.msg.subscribe((data) => {
      this.msgs = [data];
    });
  }
}
